import { Routers } from "./routers";
import { Login } from "./pages";
import { Route, Switch, withRouter } from "react-router-dom";
// 公共样式
import "./asset/css/base.css";

// import Index from "./pages/Login/index";

function App() {
  return (
    // <ReducerProvider>
    //   <div className="main">
    //     <Layer />
    //   </div>
    // </ReducerProvider>
    <Switch>
      {/* 路由匹配 */}
      {Routers.map((route) => (
        <Route
          exact={!route.notExect}
          key={route.path}
          path={route.path}
          component={route.component}
        ></Route>
      ))}
      {/* 默认路由设置---login */}
      <Route path="/" component={Login} exact></Route>
    </Switch>
  );
}
// withRouter 包裹 跳转
export default withRouter(App);
